<template>
    <div>
        <p>商品名称：<input type="text" v-model="name"></p>
        <p>商品价格：<input type="text" v-model="price"></p>
        <button @click="add()">增加商品</button>
    </div>
</template>

<script>
export default {
    name: 'RikaoTop',

    data() {
        return {
            list:{
                name:'',
                 price:"",
            }
        
        };
    },

    mounted() {
        
    },

    methods: {
        add(){
            if(this.list.name==""||this.list.price==""){
                return alert('内容不能为空')
            }

        }
    },
};
</script>

<style scoped>

</style>